<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::get('/hello',function(){
    return 'hello';
    });

Route::get('/', function () {
    return view('welcome');
});
//路由参数
Route::get('find2/{id}', function ($id) {
    return '输入的id为'.$id;
});
//可选路由参数
Route::get('find2/{id?}', function ($id=0) {
    return'输入的id为'.$id;
});
//重定向路由
Route::redirect('/hello','/');
//路由器别名
Route::get('hi/my', function () {
    return'hello 123!';
}) ->name('123');
//路由分组:
Route::group(['prefix'=>'admin'], function () {
    Route::get('hello', function () {
        return'admin/hello';
    });
    Route::get('login', function () {
        return'admin/login';
    });
});
    
Route::get('test/show','Admin\TestController@show');
Route::get('test/form','Admin\TestController@form');
Route::post('test/transfer','Admin\TestController@transfer')->name('trans');

Route::get('test/profile','Admin\TestController@profile');
Route::post('test/store','Admin\TestController@store')->name('store');
Route::get('test/testSession','Admin\TestController@testSession');

Route::group(['middleware'=>['test']], function () {
    Route::get('/', function () {
        return view('welcome');
    });
});

Route::get('user/login','UserController@login');
Route::post('user/check','UserController@check')->name('check');
Route::get('user/index','UserController@index')->middleware('user');
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('test/database', 'Admin\TestController@database');
Route::get('test/save','Admin\TestController@member');
Route::get('test/test','Admin\TestController@test');

Route::get('test/avatar','Admin\TestController@avatar');
Route::post('test/up','Admin\TestController@up');

Route::get('test/user','Admin\TestController@user');

Route::get('test/captcha','Admin\TestController@captcha');
Route::post('test/checkCaptcha','Admin\TestController@checkCaptcha');

Route::get('test/cache','Admin\TestController@cache');
Route::get('test/testArr','Admin\TestController@testArr');
Route::get('test/testStr','Admin\TestController@testStr');
Route::get('test/testURL','Admin\TestController@testURL');
Route::get('test/xmldata','Admin\TestController@xmldata');
Route::get('test/xml','Admin\TestController@xml');
Route::get('test/jsondata','Admin\TestController@jsondata');
Route::get('test/json','Admin\TestController@json');
